# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-crc8
pkgver=0.2.0
pkgrel=1
pkgdesc="A module with the CRC8 algorithm for Python"
url="https://github.com/niccokunzmann/crc8"
license=('MIT')
arch=('any')
depends=('python')
makedepends=('python-setuptools')
source=("$pkgname-$pkgver.tar.gz::https://github.com/niccokunzmann/crc8/archive/v$pkgver.tar.gz")
sha512sums=('142b62baec2e83ea668037df9bb2d240fa22fe8d6957799453630f4667a3c7ecf8f097e3907ce0032f4c8caf729623e07d32e1501ec2ff157393ce08f4531f9b')

build() {
  cd crc8-$pkgver
  python setup.py build
}

check() {
  cd crc8-$pkgver
  python test_crc8.py
}

package() {
  cd crc8-$pkgver
  python setup.py install --root="$pkgdir" --optimize=1

  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
}
